package com.santu.edu.supporter.biz.order.pojo.enums;

import com.santu.edu.supporter.exception.BizException;
import com.santu.edu.supporter.exception.CustomError;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author luoyaoqi
 * @createTime 2024/3/18
 * @description
 */
@AllArgsConstructor
@Getter
public enum SendGoodType {

    /**
     *
     */
    UNSHIPPED(0, "未发货"),
    EXPRESS(1, "快递"),
    HUO_LA_LA(2, "货拉拉"),;

    private final Integer code;

    private final String desc;

    public static SendGoodType convert(Integer code) {
        for (SendGoodType e : SendGoodType.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        throw BizException.causeBy(CustomError.ENUM_CONVERT_ERROR,"SendGoodType转换异常");
    }
}
